#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>

inline std::string GetLower(std::string& word) {
	for (int i = 0; i < word.size(); i++) {
		if (word[i] >= 'A' && word[i] <= 'Z') {
			word[i] = word[i] - 'A' + 'a';
		}
	}
	return word;
}

struct Node {
	std::string word;
	int count;

	Node():word(""), count(0) {}
};


bool MyCompare( Node a,  Node b) {
	return a.count > b.count;
}

/**
 * 
 * 测试链接：https://www.luogu.com.cn/problem/B4262
 */
int main() {
	std::string arr[110] = {};
	Node result[110]{};

	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		std::string word;
		std::cin >> word;
		std::string lowerWord = GetLower(word);
		arr[i] = lowerWord;
	}

	int resultIdx = 0;
	for (int i = 0; i < n; i++) {
		std::string word = arr[i];
		bool hasWord = false;
		for (int j = 0; j < n; j++) {
			if (word == result[j].word) {
				hasWord = true;
				result[j].count++;
				break;
			}
		}
		if (!hasWord) {
			result[resultIdx].word = word;
			result[resultIdx].count++;
			resultIdx++;	
		}
	}

	std::sort(result, result + resultIdx, MyCompare);

	std::cout << result[0].word;

	return 0;
}
